#INCLUDE "Protheus.Ch"

User Function Cnab001

nInstru1 := 0     

IF !Empty(SE1->E1_VALJUR)
	nInstru1  := SE1->E1_VALJUR
ElseIf SE1->E1_PORCJUR > 0
	nInstru1  := (SE1->E1_SALDO*SE1->E1_PORCJUR)/100
Else
	nInstru1  := (SE1->E1_SALDO*GetMv("MV_TXPER"))/100
EndIf

Return(nInstru1)

User Function Cnab002

nInstru1 := 0     

IF !Empty(SE1->E1_PORCJUR)
	nInstru1  := (SE1->E1_PORCJUR)/100
Else
	nInstru1  := (GetMv("MV_TXPER"))/100
EndIf

Return(nInstru1) 


User Function Cnab003

Local nRet

SA1->(DbSetOrder(1))
SA1->(dbSeek(xFilial("SA1")+SE1->E1_CLIENTE+SE1->E1_LOJA ))

nRet := IIF( SA1->A1_PESSOA = "F" , 01 , 02 )     


Return(nRet)
